package com.gitee.minimalismstyle.fresh.common.document.xml

import com.gitee.minimalismstyle.fresh.common.document.util.ExeclUtils
import javax.xml.bind.annotation.adapters.XmlAdapter

class StringToIntXmlAdapter : XmlAdapter<String, Int>() {

    override fun unmarshal(str: String?): Int? {
        return if(str.isNullOrBlank()){
            null
        } else {
            str.toInt()
        }
    }

    override fun marshal(i: Int?): String? {
        return if(i == null){
            null
        } else {
            i.toString()
        }
    }
}